Repository navigation
foreach-index-key: cut review-constructed source shapes - #41
Conversation
… foreach-index-key (reverts d857f42)
@builder run several times, Repeat rows)
…e is a reassignment, this.F ?? [] has no root
…head array stays quiet, one to the tail reports
…al roots in one conditional; the root field alone decides
…slice(-5)]) and slice(0, 0) as a clear
…0, n) window; its bound is a window end anywhere in the chain
…mments the cuts left
…; R4 $$ with a normalized text
… applies to lazyforeach-source-rebuilt, Repeat rows aren't marked as loops; $$ comment
ArcsinX
left a comment
There was a problem hiding this comment.
Reviewed a118289 (commit-by-commit across all 9 commits).
- CI (
test,test (ubuntu-latest),test (windows-latest)) passed ona118289(DeepSeek PR Review/reviewskipped). - The code cuts across
component.ts,loops.ts,callbacks.ts,syntax.ts,inputs.ts,engine.ts,facts.ts,queries.ts, andR1.tsare clean and internally consistent, and the matching test removals inR1-index.test.ts,loops.test.ts, andR4.test.tsmatch the cuts. - Found a couple of inaccuracies/omissions in
docs/exec-plans/tech-debt-tracker.mdwhere the documented behavior doesn't match the compacted code (posted inline).
PR Reviewer Guide 🔍(Review updated until commit 8226a1e)Here are some key observations to aid the review process:
✅ Resolved findingsarkui-sem/src/engine.ts:383-385Incorrect Dropping the |
DeepSeek review: Approved (
|
…an append stays quiet through a getter
ArcsinX
left a comment
There was a problem hiding this comment.
Re-reviewed f1b43db (diff against 7c16784, plus the incremental diff from a118289).
- CI: all 4 checks (
test,test (ubuntu-latest),test (windows-latest),DeepSeek PR Review/review) passed onf1b43db. - Prior
ArcsinXreview threads:- Resolved the
[...this.a, ...this.b]in-place thread (tech-debt-tracker.md:40) — addressed inf1b43db. - Left the other two threads unresolved as they are not addressed yet:
tech-debt-tracker.md:37:shape === 'call'suppression ofkeepsArraywrites and in-place index writes for conditionals/fallbacks.tech-debt-tracker.md:48: missing entries for the cuts in5b2e805([...this.F.slice(-5)],[...this.F.slice(0, this.n)],this.F.slice(0, 0)) and496a4be(c ? [...this.F] : []).
- Resolved the
- Code cuts across
src/andtest/remain internally consistent and match CI; noted a few remaining inaccuracies indocs/exec-plans/tech-debt-tracker.mdinline (plus the open DeepSeek bot thread onarkui-sem/src/engine.ts:385regarding$$on normalizedonChangehandlers).
…, in place of per-shape lines
There was a problem hiding this comment.
Automated DeepSeek review found no blocking concerns in 8226a1e.
ArcsinX
left a comment
There was a problem hiding this comment.
LGTM!
Re-reviewed 8226a1e (plus 665a88d):
- Addressed all three remaining
ArcsinXthreads ondocs/exec-plans/tech-debt-tracker.md— the general no-root rule in8226a1eaccurately matchesarkui-sem/src/ets/loops.tsandarkui-sem/src/rules/R1.ts(selection semantics in place,keepsArraysuppressed through a method/getter unlessreorders,reordersand.slice(0, n)rules still applying). Resolved all three threads. - Code cuts and test removals across
arkui-sem/src/andarkui-sem/test/remain clean and internally consistent. - CI (
test,test (ubuntu-latest),test (windows-latest)) passed on8226a1e(DeepSeek PR Review/reviewstill in progress at time of approval).
What and why
Compacts R1
foreach-index-key(#37). Under AI review its source grew from +317 to +900 lines. Each comment named another syntactic variant, each was fixed, and each fix invited the next. This PR cuts the variants that real list code rarely writes. Each cut case falls back to what the first-review version did: it reports, or stays quiet, as the simpler code decides. Common shapes stay covered: filtered and sorted sources, getter and method sources,ifarms around the loop,slice(0, n)windows and show-all toggles, appends,[...this.F].sort(), a single-root conditional.Cut (one commit each; the tech-debt tracker records the side the important ones now take, not the rare spellings such as a copy around a reorder or
slice(0, 0)):this.trip.tags, object spreads of the holder), and several roots in one conditional??/||fallbacks andnullclears.concat(x)and spread tailsifarms (an outer loop row, a @builder run several times,Repeatrows)[...this.F.slice(-5)]),slice(0, 0)as a clearslice(0, n)window$$normalized-text check, which landed with R1 foreach-index-key: index-keyed ForEach over items that change (coverage step 5a) #37 but belongs toinput-unboundLine counts of #37 (additions against its base):
c5a829c)How it was checked
npm testandnpm run lintinarkui-sem/after each commit. Each cut removes its own tests; the remaining tests are unchanged apart from dropped spellings.sandbox/demo(heuristic backend): the same findings as main.Notes for the reviewer